package com.serviceprovider.business.module.admin.transaction.model;

public class CSVToFlatTableMappingData {
    private String csvFileField;
    private String flatTableField;
    private int    id;
    private int    mappingId;

    @Override
    public boolean equals(Object obj) {
        if ((obj == null) ||!(obj instanceof CSVToFlatTableMappingData)) {
            return false;
        }

        CSVToFlatTableMappingData b = (CSVToFlatTableMappingData) obj;

        if (id != b.id) {
            return false;
        }

        if (mappingId != b.mappingId) {
            return false;
        }

        boolean eq = ((csvFileField == null) && (b.csvFileField == null))
                     || ((csvFileField != null) && csvFileField.equals(b.csvFileField));

        if (!eq) {
            return false;
        }

        eq = ((flatTableField == null) && (b.flatTableField == null))
             || ((flatTableField != null) && flatTableField.equals(b.flatTableField));

        if (!eq) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int prime  = 31;
        int result = 1;

        result = prime * result + id;
        result = prime * result + mappingId;
        result = prime * result + ((csvFileField == null)
                                   ? 0
                                   : csvFileField.hashCode());
        result = prime * result + ((flatTableField == null)
                                   ? 0
                                   : flatTableField.hashCode());

        return result;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCsvFileField() {
        return csvFileField;
    }

    public void setCsvFileField(String csvFileField) {
        this.csvFileField = csvFileField;
    }

    public String getFlatTableField() {
        return flatTableField;
    }

    public void setFlatTableField(String flatTableField) {
        this.flatTableField = flatTableField;
    }

    public int getMappingId() {
        return mappingId;
    }

    public void setMappingId(int mappingId) {
        this.mappingId = mappingId;
    }
}



